import {IComponent, TagData, VideoData} from "@/types/AllData";

// 这里本想通过类来实例化各种对象,后来发现有点麻烦,暂时搁置,继续使用接口来定义类型
export class VideoDataObj implements VideoData{
    commentList: null;
    comment_num: number;
    cover_pic: string;
    info: string;
    length: number;
    play_num: number;
    star_num: number;
    status: number;
    storage: string;
    tagList: TagData[];
    title: string;
    up_time: string;
    uuid: number;
    videoid: number;

    // 构造函数重载
    constructor();
    constructor(obj:VideoData);

    constructor(obj?:VideoData) {
        this.commentList = obj && obj.commentList || null;
        this.comment_num = obj && obj.comment_num || 0;
        this.cover_pic = obj && obj.cover_pic || "";
        this.info = obj && obj.info || "";
        this.length = obj && obj.length || 0;
        this.play_num = obj && obj.play_num || 0;
        this.star_num = obj && obj.star_num || 0;
        this.status = obj && obj.status || 0;
        this.storage = obj && obj.storage || "";
        this.tagList = obj && obj.tagList || [];
        this.title = obj && obj.title || "";
        this.up_time = obj && obj.up_time || "";
        this.uuid = obj && obj.uuid || 0;
        this.videoid = obj && obj.videoid || 0;
    }
}
export const PageStack:Record<any, any>[]=[]


